package com.atguigu.srb.sms.controller;

import com.atguigu.common.results.R;
import com.atguigu.srb.sms.service.SmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/sms")

public class SmsController {
    //消费者：消费消息，发送短信
    @Autowired
    SmsService smsService;
    @GetMapping("send/{mobile}/{type}")
    public R sendMsg(@PathVariable("mobile")String mobile,
                     @PathVariable("type") Integer type){
        smsService.sendMsg(mobile,type);

        return R.success().message("短信发送成功");
    }


}
